//
//  ReferralNetworkCell.swift
//  SCA
//
//  Created by tjun on 2025/9/21.
//

import UIKit

class ReferralNetworkCell: UICollectionViewCell {
    
    let textLabel = GradientTextLabel(font: UIFontMake(14))
    let accountLabel = UILabel(font: UIFontMediumMake(15), textColor: UIColor.gray)
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.backgroundColor = .clear
        
        let backgroundImageView = UIImageView()
        backgroundImageView.addTo(self.contentView)
        backgroundImageView.image = UIImage(named: "referralNetwork_border")
        backgroundImageView.snp.makeConstraints { make in
            make.width.height.equalTo(50)
            make.centerY.equalToSuperview()
            make.left.equalTo(AppStyle.margin.left)
        }
        
        textLabel.colors = [UIColorMake(0x05D4FC), UIColorMake(0xBE0DEF), UIColorMake(0xF202D3)]
        textLabel.addTo(backgroundImageView)
        textLabel.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        
        accountLabel.addTo(self.contentView)
        accountLabel.snp.makeConstraints { make in
            make.left.equalTo(textLabel.snp.right).offset(16)
            make.centerY.equalToSuperview()
        }

        
    }
    
    var model: ReferralNetworkModel! {
        didSet {
            textLabel.text = model.title
            accountLabel.text = model.account
        }
    }
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
